package com.wys.ws_im.exception;

/**
 * 枚举
 */
public enum FrameErrorCodeEnums implements IErrorCode {

    /**
     * 枚举
     */
    SUCCESS(0, "处理成功"),
    SERVER_INTERNAL_ERROR(-1, "服务器内部错误"),
    UNKNOWN_ERROR(-100, "未知错误"),
    DB_ERROR(-101, "数据库错误"),
    UNAUTHORIZED_URL(401, "未授权URL"),
    BIND_ARGS_ERROR(403, "参数异常"),
    NOT_LOGIN_ERROR(405, "账号未登录，请先登录！"),


    ADD_SHOP_SUCCESS(220, "增加商店成功"),

    ACCOUNT_PASSWORD_ERROR(420, "账号或密码错误"),
    ACCOUNT_ERROR(421, "账号已被注册"),
    SHOP_ERROR(421, "商店已被注册"),
    ACCOUNT_SHOP_ERROR(422, "店主id已注册有商店"),


    SHOP_SERVICE_ERROR(432, "商店或客服不存在"),
    ACCOUNT_NULL_ERROR(433, "账号不存在"),
    ACCOUNT_ROLE_ERROR(434, "账号角色错误"),
    SHOP_SERVICE_ALREADY(435, "商店已经有这名客服"),
    SERVICE_HAVE_ERROR(436, "这个客服已被其他商店添加"),
    SERVICE_NOT_ERROR(437, "这个账号不是客服"),

    SHOP_NULL_ERROR(438, "商店不存在"),
    SERVICE_NULL_ERROR(439, "客服不存在"),
    ;

    private Integer code;
    private String msg;

    FrameErrorCodeEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public IErrorCode setMsg(String msg) {
        this.msg = msg;
        return this;
    }
}
